<!--Copyright (C) Kherty.  All rights reserved.-->
<oui:Ribbon x:Class="OpenLS.Spreadsheet.UI.SpreadsheetRibbon"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:oui="http://schemas.Kherty.com/office/2007"
    xmlns:ssui="clr-namespace:OpenLS.Spreadsheet.UI"
    xmlns:ss="http://schemas.Kherty.com/office/2007/spreadsheet"
    xmlns:chart="http://schemas.Kherty.com/office/2007/chart"
    xmlns:drawing2="clr-namespace:OpenLS.Drawing.UI;assembly=OpenLS.Drawing.UI"
      xmlns:media="http://schemas.Kherty.com/office/2007/media"
      xmlns:Internals="clr-namespace:OpenLS.Spreadsheet.UI.Internals"
      xmlns:Internals2="clr-namespace:OpenLS.Chart.UI.Internals;assembly=OpenLS.Chart.UI"
      xmlns:Internals1="clr-namespace:OpenLS.UI.Internals;assembly=OpenLS.UI"
            xmlns:Resources="clr-namespace:OpenLS.Spreadsheet.UI.Internals.Resources"
            DockPanel.Dock="Top"
             ssui:SpreadsheetElement.Workbook="{Binding}" 
            
             Name="ribbon" 
              FocusManager.IsFocusScope="True"
              Margin="00 00 0 0"
              drawing2:DrawingElement.Theme="{Binding Path=(ssui:SpreadsheetElement.Workbook).Theme, RelativeSource={RelativeSource Self}}"
              drawing2:DrawingElement.ColorScheme="{Binding Path=(ssui:SpreadsheetElement.Workbook).Theme.ColorScheme, RelativeSource={RelativeSource Self}}"
          
>
    <!--  DataContext="{Binding Path=View.ActiveSheet}"-->
    <ssui:SpreadsheetElement.Worksheet>
        <Binding Path="View.ActiveSheet">
            <Binding.Converter>
                <ssui:AsConverter Type="{x:Type ss:Worksheet}"/>
            </Binding.Converter>
        </Binding>
    </ssui:SpreadsheetElement.Worksheet>
    <oui:RibbonElement.IconProvider>
        <media:IconProvider />
    </oui:RibbonElement.IconProvider>
  <oui:Ribbon.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <oui:MenuResources/>
                <ssui:CellStyleResources/>
                <ssui:TableStyleResources/>
                <chart:DesignTabResources/>
                <!--<ResourceDictionary Source="obsoleteResources.xaml" /> -->
        <ResourceDictionary Source="/OpenLS.UI;component/Themes/ButtonGroupResources.xaml"/>
        <!--<ResourceDictionary Source="/OpenLS.Chart.UI;component/DesignTabResources.xaml"/>
                <ResourceDictionary Source="HomeTabResources.xaml"/>
                <ResourceDictionary Source="InsertTabResources.xaml"/>
                <ssui:PageLayoutTabResources/>
                <ResourceDictionary Source="FormulaTabResources.xaml"/>
                <ResourceDictionary Source="ViewTabResources.xaml"/>
                <ResourceDictionary Source="ReviewTabResources.xaml"/>
                <ResourceDictionary Source="DataTabResources.xaml"/> -->
            </ResourceDictionary.MergedDictionaries>
            <GroupStyle HidesIfEmpty="False" x:Key="defaultGroupStyle">
                <GroupStyle.HeaderTemplate>
                    <HierarchicalDataTemplate DataType="{x:Type CollectionViewGroup}">
                        <Border BorderThickness="0 0 0 1" BorderBrush="#FFC5C5C5">
                            <TextBlock Text="{Binding Name}" Background="#FFDDE7EE" FontWeight="Bold"/>
                        </Border>
                    </HierarchicalDataTemplate>
                </GroupStyle.HeaderTemplate>
            </GroupStyle>

        </ResourceDictionary>


    </oui:Ribbon.Resources>
    <oui:Ribbon.InputBindings>
      <KeyBinding Command="{x:Static ssui:SpreadsheetCommands.CalculateWorksheet}" Key="F9" Modifiers="Shift"/>
      <KeyBinding Command="{x:Static ssui:SpreadsheetCommands.CalculateWorkbook}" Key="F9"/>
    </oui:Ribbon.InputBindings>
    <TabItem Header="{x:Static Resources:UIStringTable.File}" Name="File" 
             Selector.Selected="onDimensionTabSeleted"
             >
    </TabItem>
    <TabItem Header ="{x:Static Internals1:UIStringTable.Home}" Selector.Selected="onHomeTabSelected">
    </TabItem>
    <TabItem Header ="{x:Static Internals1:UIStringTable.Insert}" Selector.Selected ="onInsertTabSelected"/>
        <TabItem Header ="{x:Static Resources:UIStringTable.PageLayout}" Selector.Selected="onPageLayoutTabSelected" >
    </TabItem>

    
    <TabItem Header ="{x:Static Resources:UIStringTable.Formulas}" Selector.Selected="onFormulaTabSelected" >
    </TabItem>
    <TabItem Header ="{x:Static Resources:UIStringTable.Data}" Selector.Selected="onDataTabSelected">
    </TabItem>
    <TabItem Header ="{x:Static Resources:UIStringTable.Review}" Selector.Selected="onReviewTabSelected">
    </TabItem>
    <TabItem Header ="{x:Static Resources:UIStringTable.View}" Selector.Selected="onViewTabSelected">
    </TabItem>
    
</oui:Ribbon>
